package com.poi.demopoi.aatest;

import cn.hutool.core.lang.Assert;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.ObjectUtils;

import java.lang.reflect.Array;
import java.util.*;
import java.util.stream.Collectors;

public class MT {
    List<Integer> ints = Arrays.asList(1, 2, 3, 4, 5);

    public static void main(String[] args) throws Exception {
        ArrayList arrayList = new ArrayList();
//        arrayList.removeIf()

        List<String> dbSku = Arrays.asList("蓝色,M", "蓝色,L", "黄色,M", "黄色,L");
        List<String> inSku = Arrays.asList("蓝色,M", "蓝色,L",                  "绿色,M", "绿色,L");
        //要删除(参照物为已持久化的dbSku)的sku: db中已经存在的但in中已不再的 需要删除
        List<String> remove_sku = dbSku.stream().filter(x -> !inSku.contains(x)).collect(Collectors.toList());

        //获取新增(参照物为inSku)的sku信息
//        List<PmsSkuStock> insertSkuList = inSku.stream().filter(x->x.getId()==null).collect(Collectors.toList());
        List<String> insertSkuList = inSku.stream().filter(x -> !dbSku.contains(x)).collect(Collectors.toList());

        //获取需要更新的sku信息: 只针对库存
//        List<String> updateSkuList = inSku.stream().filter(x->x.getId()!=null).collect(Collectors.toList());

        System.out.println();

    }


}
